package com.zhdl.modules.prefiresys.conf.error;

import lombok.extern.slf4j.Slf4j;

import java.util.LinkedList;
import java.util.Queue;

/**
 * 异常消息队列
 */
@Slf4j
public class ErrorMsgQueue {
    private static final Queue<ErrorMsgDto> queue = new LinkedList<>();

    /**
     *
     */
    public static void push(ErrorMsgDto element) {
        log.error(element.getMsg());
        queue.offer(element);
    }

    /**
     *
     */
    public static ErrorMsgDto pop() {
        return queue.poll();
    }

    /**
     *
     */
    public static int size() {
        return queue.size();
    }
}
